﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;

namespace MiniFox.Mail
{
    /// <summary>
    /// 
    /// </summary>
    public class MailErrorEventArgs : EventArgs
    {
        IMailAccount _mailAccount;
        MailMessage _mailMsg;
        Exception _exception;
        bool _isAsync;
        bool _ignoreError;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mailAccount"></param>
        /// <param name="mailMsg"></param>
        /// <param name="isAsync"></param>
        /// <param name="exception"></param>
        public MailErrorEventArgs(IMailAccount mailAccount, MailMessage mailMsg, bool isAsync, Exception exception) : this(mailAccount, mailMsg, isAsync, exception, false)
        {

        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mailAccount"></param>
        /// <param name="mailMsg"></param>
        /// <param name="isAsync"></param>
        /// <param name="exception"></param>
        /// <param name="ignoreError"></param>
        public MailErrorEventArgs(IMailAccount mailAccount, MailMessage mailMsg, bool isAsync, Exception exception, bool ignoreError)
        {
            _mailAccount = mailAccount;
            _mailMsg = mailMsg;
            _exception = exception;
            _isAsync = isAsync;
            _ignoreError = ignoreError;
        }
        /// <summary>
        /// 
        /// </summary>
        public IMailAccount MailAccount
        {
            get
            {
                return _mailAccount;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public MailMessage MailMessage
        {
            get
            {
                return _mailMsg;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public Exception Error
        {
            get
            {
                return _exception;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public bool IsAsync
        {
            get
            {
                return _isAsync;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public bool IgnoreError
        {
            get
            {
                return _ignoreError;
            }
            set
            {
                _ignoreError = value;
            }
        }
    }
}
